﻿@model EnterpriseFund.Model.DM_YSFPBL
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script type="text/javascript">
        function OK() {

            lpModal.Show();
            var fYSFPBL_DM = tbYSFPBL_DM.GetText();
            var fYSFPBL_MC = tbYSFPBL_MC.GetText();
            var fBL1_ZY = tbBL1_ZY.GetText();
            var fBL2_SS = tbBL2_SS.GetText();
            var fBL3_DS = tbBL3_DS.GetText();
            var fBL4_XQ = tbBL4_XQ.GetText();
            var fBL5_XZ = tbBL5_XZ.GetText();
            var fGS_YSFPBL_MC = tbGS_YSFPBL_MC.GetText();
            var fYXBZ = "";
            if (tbYXBZ.GetChecked()) {
                fYXBZ = "Y";
            }
            else {
                fYXBZ = "N";
            }



            if (pd(fYSFPBL_DM, fYSFPBL_MC)) {
                fYSFPBL_DM = ASPxClientUtils.Trim(fYSFPBL_DM);
                fYSFPBL_MC = ASPxClientUtils.Trim(fYSFPBL_MC);
                fBL1_ZY = ASPxClientUtils.Trim(fBL1_ZY);
                fBL2_SS = ASPxClientUtils.Trim(fBL2_SS);
                fBL3_DS = ASPxClientUtils.Trim(fBL3_DS);
                fBL4_XQ = ASPxClientUtils.Trim(fBL4_XQ);
                fBL5_XZ = ASPxClientUtils.Trim(fBL5_XZ);
                fYXBZ = ASPxClientUtils.Trim(fYXBZ);
                fGS_YSFPBL_MC = ASPxClientUtils.Trim(fGS_YSFPBL_MC);
                //alert(fYSFPBL_DM + fYSFPBL_MC + fBL1_ZY + fBL2_SS + fBL3_DS + fBL4_XQ + fBL5_XZ + fYXBZ + fGS_YSFPBL_MC);
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/YSFPBLManager/YSFPBLSave',
                    data: { YSFPBL_DM: fYSFPBL_DM, YSFPBL_MC: fYSFPBL_MC, BL1_ZY: fBL1_ZY, BL2_SS: fBL2_SS, BL3_DS: fBL3_DS, BL4_XQ: fBL4_XQ, BL5_XZ: fBL5_XZ, GS_YSFPBL_MC: fGS_YSFPBL_MC, YXBZ: fYXBZ, isAdd: '@ViewData["blcodeNo"]' },
                    success: function (result) {
                        lpModal.Hide();
                        if (result == "exists") {
                            tbYSFPBL_DM.SetErrorText("编码已存在");
                            tbYSFPBL_DM.SetIsValid(false);
                        } else if (result == "ok") {
                            parent.codeOK();
                        } else if (result == "error") {
                            alert("保存失败");
                        }
                    }
                });

            } else {
                lpModal.Hide();
            }

        }


        function pd(codeNo, codeName) {
            var bl = true;
            if (null == codeNo || ASPxClientUtils.Trim(codeNo) == "") {
                tbYSFPBL_DM.SetErrorText("请填写分配代码");
                tbYSFPBL_DM.SetIsValid(false);
                bl = false;
            }
            if (null == codeName || ASPxClientUtils.Trim(codeName) == "") {
                tbYSFPBL_MC.SetErrorText("请填写分配名称");
                tbYSFPBL_MC.SetIsValid(false);
                bl = false;
            }
            //                        if (null == gscodename || ASPxClientUtils.Trim(gscodename) == "") {
            //                tbYSFPBL_MC.SetErrorText("请填写国税征收名称");
            //                tbYSFPBL_MC.SetIsValid(false);
            //                bl = false;
            //            }
            return bl;
        }

    </script>
</head>
<body>
    <table class="tableFrom">
        <tr>
            <th style="width: 150">
                分配比例代码:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbYSFPBL_DM";
                   settings.Width = 150;
                   if ((bool)@ViewData["blcodeNo"])
                   {
                       settings.ReadOnly = false;
                   }
                   else
                   {
                       settings.ReadOnly = true;
                   }
                   settings.Text = Model.YSFPBL_DM;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                分配比例名称:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbYSFPBL_MC";
                   settings.Width = 150;
                   settings.Text = Model.YSFPBL_MC;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                中央级比例:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbBL1_ZY";
                   settings.Width = 150;
                   settings.Text = Model.BL1_ZY.ToString();
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                省市级比例:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbBL2_SS";
                   settings.Width = 150;
                   settings.Text = Model.BL2_SS.ToString();
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                地市级比例:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbBL3_DS";
                   settings.Width = 150;
                   settings.Text = Model.BL3_DS.ToString();
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                县区级比例:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbBL4_XQ";
                   settings.Width = 150;
                   settings.Text = Model.BL4_XQ.ToString();
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                乡镇级比例:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbBL5_XZ";
                   settings.Width = 150;
                   settings.Text = Model.BL5_XZ.ToString();
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                国税分配比例名称:
            </th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "tbGS_YSFPBL_MC";
                   settings.Width = 150;
                   settings.Text = Model.GS_YSFPBL_MC;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style="width: 150">
                有效标志:
            </th>
            <td>
                @Html.DevExpress().CheckBox(settings =>
               {
                   settings.Name = "tbYXBZ";
                   settings.Width = 150;
                   if (Model.YXBZ == "Y")
                   {
                       settings.Checked = true;
                   }
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
    </table>
    <script>
        lp.Hide();
    </script>
</body>
</html>
